//
//  LNViewModel.h
//  LNDevelopExample
//
//  Created by wwww on 2018/9/5.
//  Copyright © 2018年 淘发现1iOS. All rights reserved.
// 所有自定义的视图模型的基类

#import <Foundation/Foundation.h>

/// 传递导航栏title的key：例如 导航栏的title...
FOUNDATION_EXTERN NSString *const LNViewModelTitleKey;

@protocol LNViewModelServices;

@interface LNViewModel : NSObject

/// 初始化控制器
- (instancetype)initWithServices:(id<LNViewModelServices>)services params:(NSDictionary *)params;
/// 整个应用层管理类
@property (nonatomic, readonly, strong) id<LNViewModelServices> services;
/// 页面导航需要带的参数
@property (nonatomic, readonly, copy) NSDictionary *params;
/// 导航标题
@property (nonatomic, readwrite, copy) NSString *title;
/// 如果设置了该值，那么当Push到一个新的控制器,则导航栏左侧返回按钮的title为backTitle
@property (nonatomic, readwrite, copy) NSString *backTitle;
/// 当Push/Present时，通过block反向传值
@property (nonatomic, readwrite, copy) VoidBlock_id callback;
/// 监听错误
@property (nonatomic, readonly, strong) RACSubject *errors;
/** should fetch local data when viewModel init  . default is YES */
@property (nonatomic, readwrite, assign) BOOL shouldFetchLocalDataOnViewModelInitialize;
/** 是否需要在控制器viewDidLoad */
@property (nonatomic, readwrite, assign) BOOL shouldRequestRemoteDataOnViewDidLoad;
/// will disappear signal
@property (nonatomic, strong, readonly) RACSubject *willDisappearSignal;
/// stack. (是否取消掉左滑pop到上一层的功能（栈底控制器无效），默认为NO，不取消)
@property (nonatomic, readwrite, assign) BOOL interactivePopDisabled;
/// 是否隐藏该控制器的导航栏 默认是不隐藏 (NO)
@property (nonatomic, readwrite, assign) BOOL prefersNavigationBarHidden;
/// 是否隐藏该控制器的导航栏底部的分割线 默认不隐藏 （NO）
@property (nonatomic, readwrite, assign) BOOL prefersNavigationBarBottomLineHidden;
/// 是否让IQKeyboardManager的管理键盘的事件 默认是YES（键盘管理）
@property (nonatomic, readwrite, assign) BOOL keyboardEnable;
/// 是否键盘弹起的时候，点击其他局域键盘弹起 默认是 YES
@property (nonatomic, readwrite, assign) BOOL shouldResignOnTouchOutside;
/// To set keyboard distance from textField. can't be less than zero. Default is 10.0.
/// keyboardDistanceFromTextField
@property (nonatomic, readwrite, assign) CGFloat keyboardDistanceFromTextField;

- (void)initialize;
@end
